import axios from '../utils/axios'

// 系统日志相关API
export const systemLogApi = {
  // 获取数据导入记录
  getUploadLogs(params = {}) {
    return axios.get('/system/logs/upload', { params })
  },

  // 获取API调用日志
  getApiLogs(params = {}) {
    return axios.get('/system/logs/api', { params })
  },

  // 获取操作日志
  getOperationLogs(params = {}) {
    return axios.get('/system/logs/operation', { params })
  },

  getDecrypt(data = {}) {
    return axios.post('/system/logs/decrypt', { data })
  },


  // 删除日志记录
  deleteLog(logId, logType) {
    return axios.delete(`/system/logs/${logType}/${logId}`)
  },

  // 清空日志
  clearLogs(logType) {
    return axios.delete(`/system/logs/${logType}/clear`)
  },

  // 导出日志
  exportLogs(logType, params = {}) {
    return axios.get(`/system/logs/${logType}/export`, { 
      params,
      responseType: 'blob'
    })
  }
}
